
export function screen(equipment){
       		  var LIGHT = [];
       		  var AIR_CONDITION = [];
       		  var CURTAIN = [];
       		  var SCENE_TRIGGER = [];
       		  var DOORLOCK = [];
       		  for (var i = 0; i < equipment.length; i++) {
				  console.log(equipment[i].duerosType)
       		  	switch(equipment[i].duerosType){
						
       				case "LIGHT":
       						LIGHT.push({
       							avator:"/static/icon/dengOn.png",
       							static:"/static/icon/dengOff.png",
       							text:equipment[i].modelName,
       							active:1,
       							controlType: equipment[i].controlType,
       							duerosType: equipment[i].duerosType,
       							equipId: equipment[i].equipId,
       							modelName: equipment[i].modelName,
       							position: equipment[i].position,
       							positionBak: equipment[i].positionBak,
								controlType: equipment[i].controlType,
       						})
       						break;
       				case "AIR_CONDITION":
       						AIR_CONDITION.push({
       							avator:"/static/icon/dengOn.png",
       							static:"/static/icon/dengOff.png",
       							text:equipment[i].modelName,
       							active:1,
       							controlType: equipment[i].controlType,
       							duerosType: equipment[i].duerosType,
       							equipId: equipment[i].equipId,
       							modelName: equipment[i].modelName,
       							position: equipment[i].position,
       							positionBak: equipment[i].positionBak,
								controlType: equipment[i].controlType,
       						})
       						break;
					case "CURT_SIMP":
       				case "CURTAIN":
       						CURTAIN.push({
       							avator:"/static/icon/dengOn.png",
       							static:"/static/icon/dengOff.png",
       							text:equipment[i].modelName,
       							active:1,
       							controlType: equipment[i].controlType,
       							duerosType: equipment[i].duerosType,
       							equipId: equipment[i].equipId,
       							modelName: equipment[i].modelName,
       							position: equipment[i].position,
       							positionBak: equipment[i].positionBak,
								controlType: equipment[i].controlType,
       						})
       						break;
       				case "SCENE_TRIGGER":
       						switch(equipment[i].modelName){
       									  case "睡眠模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/sleep.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "起床模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/getup.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "工作模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/work.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "沐浴模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/muyu.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "明亮模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/lighting.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "柔和模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/rouhe.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "阅读模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/reading.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "休闲模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/xiuxian.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									case "总控模式":
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/zongkong.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       									default:
       										SCENE_TRIGGER.push({
       											avator:"/static/icon/zongkong.png",
       											static:"/static/icon/dengOff.png",
       											text:equipment[i].modelName,
       											active:1,
       											controlType: equipment[i].controlType,
       											duerosType: equipment[i].duerosType,
       											equipId: equipment[i].equipId,
       											modelName: equipment[i].modelName,
       											position: equipment[i].position,
       											positionBak: equipment[i].positionBak,
												controlType: equipment[i].controlType,
       										})
       										break;
       						}
       						break;
       					case "DOORLOCK":
       							DOORLOCK.push({
       								avator:"/static/icon/dengOn.png",
       								static:"/static/icon/dengOff.png",
       								text:equipment[i].modelName,
       								active:1,
       								controlType: equipment[i].controlType,
       								duerosType: equipment[i].duerosType,
       								equipId: equipment[i].equipId,
       								modelName: equipment[i].modelName,
       								position: equipment[i].position,
       								positionBak: equipment[i].positionBak,
									controlType: equipment[i].controlType,
       							})
       							break;
       			}
       		  }
			  console.log(SCENE_TRIGGER)
       		  
       		  var equipmentlist = {
       			  LIGHT,
       			  SCENE_TRIGGER,
       			  CURTAIN,
       			  AIR_CONDITION,
       			  DOORLOCK
       		  }
       		  uni.setStorageSync('equipmentlist',equipmentlist)
			  if(!uni.getStorageSync("equipmentlist")){
				  return false
			  }else{
				  return true
			  }
};


export function SCENE_TRIGGER(equipment,SCENE_TRIGGER){
		  switch(equipment.modelName){
			  case "睡眠模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/sleep.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "起床模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/getup.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "工作模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/work.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "沐浴模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/muyu.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "明亮模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/lighting.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "柔和模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/rouhe.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "阅读模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/reading.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "休闲模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/xiuxian.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			case "总控模式":
				SCENE_TRIGGER.push({
					avator:"/static/icon/zongkong.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
			default:
				SCENE_TRIGGER.push({
					avator:"/static/icon/zongkong.png",
					static:"/static/icon/dengOff.png",
					text:equipment.modelName,
					active:1,
					controlType: equipment.controlType,
					duerosType: equipment.duerosType,
					equipId: equipment.equipId,
					modelName: equipment.modelName,
					position: equipment.position,
					positionBak: equipment.positionBak,
					controlType: equipment.controlType,
				})
				break;
		  }
};
